package com.tc.controller;

import com.tc.entity.Menu;
import com.tc.excel.anno.RequestExcel;
import com.tc.excel.anno.ResponseExcel;
import com.tc.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther: tianchao
 * @Date: 2025/2/15 10:16
 * @Description:
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;
    @RequestMapping("/exportMenu")
    @ResponseExcel(excelName = "菜单列表",sheetName = "菜单列表")
    public List<Menu> exportMenu(){
        return menuService.selectMenuAll();
    }

    @RequestMapping("/importMenu")
    public List<Menu> importMenu(@RequestExcel(fileName = "file")List<Menu> menus) {
        return menus;
    }


}
